<?php
namespace Orm\PlayShowings;

class PlayShowingsModel extends \Base\BaseOrmModel{

    function __construct()
    {
        parent::__construct();
        $this->table = 't_play_showings';
    }

    /**
     * @param $week_own
     * @return array
     * 根据周次查询本周是否有未结束的赛事信息
     * status =0 表示有赛事未结束
     */
    public function getPlayShowingByWeekOwn($week_own){
        $sql = "SELECT * FROM ".$this->table." WHERE `is_del` = 0 AND `status` = 0 AND `week_own` = ".$week_own;
        return $this->_fetch($sql,1);
    }

    /**
     * @return array
     * 查询是否有未结束的赛事
     */
    public function getPlayShowing(){
        $sql = "SELECT * FROM ".$this->table." WHERE `is_del` = 0 AND `status` = 0";
        return $this->_fetch($sql,1);
    }
}